package net.huashitong.keyan.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.keyan.dao.InspectionSummaryDao;
import net.huashitong.keyan.entity.InspectionSummary;
import net.huashitong.keyan.filter.InspectionSummaryFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class InspectionSummaryService extends StringPKService<InspectionSummary> {

    @Autowired
    private InspectionSummaryDao dao;
    @Autowired
    private SysTableService tableService;

    @Override
    protected BaseDao<InspectionSummary, String> getDao() {
        return dao;
    }
    @Override
    protected void beforeSave(InspectionSummary obj) {
        obj.setSysId(tableService.updateMaxSysId("t_keyan_ins_sum",null));
    }

    public List<InspectionSummary> query(InspectionSummaryFilter filter){
        return dao.query(filter);
    }


}
